
package com.kugou.game.sdk.entity;

import android.net.Uri;

import java.io.Serializable;
import java.util.Date;

/**
 * 描述:基本信息类型，短信和彩信都分别继承 Message
 * 
 * @author ljc
 * @since 2014-3-25 下午2:30:36
 */
public abstract class Message implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -4840968840672002853L;

    public static final int FETION_MESSAGE = 0;

    public static final int SMS_MESSAGE = 1;

    public static final int MMS_MESSAGE = 2;

    private int mId;

    private String mFromNumber;// 发信息的号码

    private String mToNumber;

    private int mBoxType;// 发送或接收的信息

    private String mSubject;// 主题

    private Date mDate;

    private int mThreadId;

    private int mRead; // 1为已读，0为未读

    private int mLocked;

    private String mContactName;

    public int getSecurity() {
        return security;
    }

    public void setSecurity(int security) {
        this.security = security;
    }

    private int security;

    public int getThreadId() {
        return mThreadId;
    }

    public void setThreadId(int threadId) {
        mThreadId = threadId;
    }

    public Message() {

    }

    public String getContactName() {
        return mContactName;
    }

    public void setContactName(String contactName) {
        mContactName = contactName;
    }

    public void setSubject(String subject) {
        mSubject = subject;
    }

    /**
     * 自己发送给对方的号码
     * 
     * @param toNumber
     */
    public void setTo(String toNumber) {
        mToNumber = toNumber;
    }

    /**
     * 对方的号码（你给他发短信）
     * 
     * @return
     */
    public String getTo() {
        if (mToNumber == null) {
            return mFromNumber;
        } else {
            return mToNumber;
        }
    }

    /**
     * 他发给你的短信的号码
     * 
     * @param fromNumber
     */
    public void setFrom(String fromNumber) {
        mFromNumber = fromNumber;
    }

    /**
     * 对方的号码（他给你发短信）
     */
    public String getFrom() {
        if (mFromNumber == null) {
            return mToNumber;
        } else {
            return mFromNumber;
        }

    }

    /**
     * @param type
     */
    public void setBoxType(int type) {
        mBoxType = type;
    }

    public int getBoxType() {
        return mBoxType;
    }

    public void setId(int id) {
        mId = id;
    }

    public int getId() {
        return mId;
    }

    public String getSubject() {
        return mSubject;
    }

    public void setDate(Date time) {
        mDate = time;
    }

    public Date getDate() {
        return mDate;
    }

    public int getRead() {
        return mRead;
    }

    public void setRead(int read) {
        this.mRead = read;
    }

    public int describeContents() {
        return 0;
    }

    public void setLocked(int locked) {
        mLocked = locked;
    }

    public int getLocked() {
        return mLocked;
    }

    /**
     * @return
     */
    public abstract Uri getUri();

}
